<?php
/*
 * Created on 12.03.2008
 *
 * filename: logout.php5
 */
 class Controller_Logout extends Controller_Base {
	function index ($args) {


		$admin = new Model_Admin_User();
			
		if(!$admin->is_logged())
			return new Redirect('/admin');
		else 
			$admin->logout();			

		$redirect = new Redirect('/admin');
		
		$redirect->setCookie(
			array(
				name 	=> 'SID',
				value	=> '',
				time	=> -3600,
				path	=> '/admin'
			)
		);
		
		return $redirect;

	}
 }
?>
